//使用Jquery加载弹窗
function loadNewPopup(url){   
		// 仅在开启标志popupStatus为0的情况下加载
		var div_htm="";
		div_htm+="<div id='newPopbg'></div> ";
		div_htm+="<div id='newPopup' class='newPopup'>";  
		div_htm+="	<a id='newPopupClose' title='点击关闭窗口'>☒</a>";  
		div_htm+="	<div id='newPopArea'>";  
		div_htm+="		<iframe id='srcFrame' src='"+url+"' height='100%' width='100%' frameborder='0' scrolling='no' />"; 
		div_htm+="	</div>  "; 
		div_htm+="</div>  "; 
		$("#newPopup").remove();
		$("#newPopbg").remove();
		
		$("body").append(div_htm);
		$("#newPopbg").fadeIn("slow");
		$("#newPopup").fadeIn("slow");
		centerNewPopup();
}  
/**
 * 允许出现滚动条的弹窗
 * @param url
 */
function loadScrollingPopup(url){   
	// 仅在开启标志popupStatus为0的情况下加载
	var div_htm="";
	div_htm+="<div id='newPopbg' ></div> ";
	div_htm+="<div id='newPopup' class='newPopup'>";  
	div_htm+="	<a id='newPopupClose' title='点击关闭窗口'>☒</a>";  
	div_htm+="	<div id='newPopArea' style='margin-top:15px;'>";  
	div_htm+="		<iframe id='srcFrame' src='"+url+"' height='100%' width='100%' frameborder='0'/>"; 
	div_htm+="	</div>  "; 
	div_htm+="</div>  "; 
	$("#newPopup").remove();
	$("#newPopbg").remove();
	
	$("body").append(div_htm);
	$("#newPopbg").fadeIn("slow");
	$("#newPopup").fadeIn("slow");
	centerNewPopup();
} 
/**
 * 允许出现滚动条的弹窗_新
 * @param url
 */
function loadScrollingPopup_new(url){   
	// 仅在开启标志popupStatus为0的情况下加载
	var div_htm="";
	div_htm+="<div id='newPopbg' ></div> ";
	div_htm+="<div id='newPopup' class='newPopup'>";  
	div_htm+="	<a id='newPopupClose' title='点击关闭窗口' onclick='disableNewPopup()'>☒</a>";  
	div_htm+="	<div id='newPopArea' style='margin-top:15px;'>";  
	div_htm+="		<iframe id='srcFrame' src='"+url+"' height='100%' width='100%' frameborder='0'/>"; 
	div_htm+="	</div>  "; 
	div_htm+="</div>  "; 
	$("#newPopup").remove();
	$("#newPopbg").remove();
	
	$("body").append(div_htm);
	
	$("#newPopbg").fadeIn("slow");
	$("#newPopup").fadeIn("slow");
	centerNewPopup_new();
	var bg_height=$(document).height();
	var b_height=$("#newPopup").height();
	b_height=b_height>bg_height?b_height+200:bg_height;
	$("body").css({"height":(b_height)+"px"});
	$("#newPopbg").css({"width":"100%","height":bg_height+"px"});
} 

/**
 * 允许出现滚动条的弹窗_新
 * @param url
 */
function loadScrollingPopup_xxbc(url){   
	// 仅在开启标志popupStatus为0的情况下加载
	var div_htm="";
	div_htm+="<div id='newPopbg' style='background-color:#ffffff;opacity:0.9;'></div> ";
	div_htm+="<div id='newPopup' class='newPopup_xxbc'>";  
	div_htm+="		<iframe id='srcFrame' src='"+url+"' height='100%' width='100%' frameborder='0' style='margin:0px;'/>"; 
	div_htm+="</div>  "; 
	$("#newPopup").remove();
	$("#newPopbg").remove();
	
	$("body").append(div_htm);
	
	$("#newPopbg").fadeIn("slow");
	$("#newPopup").fadeIn("slow");
	centerNewPopup_new();
	var bg_height=$(document).height();
	var b_height=$("#newPopup").height();
	b_height=b_height>bg_height?b_height+200:bg_height;
	$("body").css({"height":(b_height)+"px"});
	$("#newPopbg").css({"width":"100%","height":bg_height+"px"});
} 

//使用Jquery去除弹窗效果 
function disableNewPopup(){   
		$("#newPopbg").fadeOut("slow");   
		$("#newPopup").fadeOut("slow");    
} 
//将弹出窗口定位在屏幕的中央
function centerNewPopup(){   
		var scrolltop=$(parent.document).scrollTop();
		var windowWidth = $(window.parent).width();   
		var windowHeight = $(window.parent).height();   
		var popupHeight = $("#newPopup").height();   
		var popupWidth = $("#newPopup").width(); 
		var layer_top=scrolltop+(windowHeight-popupHeight)/2-180;
		var layer_left=(windowWidth-popupWidth)/2;
		layer_top=layer_top>50?layer_top:50;
		//居中设置   
		$("#newPopup").css({   
			"position": "absolute",   
			"top": (layer_top)+"px",   
			"left": (layer_left)+"px" 
		});
}
//将弹出窗口定位在屏幕的中央
function centerNewPopup_new(){   
		var scrolltop=$(parent.document).scrollTop();
		var windowWidth = $(window.parent).width();   
		var windowHeight = $(window.parent).height();   
		var popupHeight = $("#newPopup").height();   
		var popupWidth = $("#newPopup").width(); 
		var layer_top=scrolltop+(windowHeight-popupHeight)/2-180;
		var layer_left=(windowWidth-popupWidth)/2;
		layer_top=layer_top>50?layer_top:50;
		//居中设置   
		$("#newPopup").css({   
			"position": "absolute",   
			"top": (layer_top)+"px",   
			"left": (layer_left)+"px" 
		});   
}
$(document).ready(function(){
	//关闭弹出窗口   
	//点击"X"所触发的事件
	/*$("#newPopupClose").on("click",function(){   
		disableNewPopup();   
	});*/
	//点击窗口以外背景所触发的关闭窗口事件!
	/*$("#newPopbg").live("click",function(){   
		disableNewPopup();   
	}); */  
	//键盘按下ESC时关闭窗口!
	$(document).keypress(function(e){   
		if(e.keyCode==27 && popupStatus==1){   
			disableNewPopup();   
		}   
	}); 
});
